import Vue from 'vue'
import Router from 'vue-router'
import index from '@/views/index'
import Login from '@/views/user/login'

Vue.use(Router)

export const constantRoutes = [
  {
    path: '*',
    redirect: '/'},//访问意料之外的路由时重定向到/personal
  {
    path: '/',
    name: 'index',
    component: index,
    meta: {
      keepAlive: false,
      login: true,
      title: '白医云·医(中心端)'
    }
  },
  {
    name:"chat",
    path: '/metaverse/chat',
    component: (resolve) => require(['@/views/metaverse/chat'], resolve),
    hidden: true,
    meta: {
      keepAlive: false,
      login: false,
      title: '白医云·医(智能问诊)'
    }
  },
  {
    name:"chatSocket",
    path: '/metaverse/chatSocket',
    component: (resolve) => require(['@/views/metaverse/socket'], resolve),
    hidden: true,
    meta: {
      keepAlive: false,
      login: false,
      title: '智能问诊'
    }
  },
  {
    name:"chatMain",
    path: '/metaverse/main',
    component: (resolve) => require(['@/views/metaverse/mainUI4'], resolve),
    hidden: true,
    meta: {
      keepAlive: false,
      login: false,
      title: '智能问诊'
    }
  },

  {
    path: '/login',
    name: 'Login',
    /*component: Login*/
    component: (resolve) => require(['@/views/metaverse/mainUI4'], resolve)
  }

]


export default new Router({
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({y: 0}),
  routes: constantRoutes
})
